package com.example.doctor.jpa;

import com.example.common.entity.TemplateDrug;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import javax.transaction.Transactional;

public interface TemplateDrugRepository extends JpaRepository<TemplateDrug,Long> {

    @Transactional
    @Modifying
    @Query(value = "DELETE FROM z_drug_template_drug WHERE tid_bigint =:tId",nativeQuery = true)
    void deleteBytId(@Param("tId") Long tId);

}
